Exercise 10: Updating records

In this exercise, records are identified in the Catalog by their IRN or Accession Number; if a matching record is found (i.e. a record with a matching IRN or Accession Number is located), the Condition fields are updated. If no record is found with a matching IRN or Accession Number, a new record will be created using the details provided.

Note: The updates in this example will only work if Accession Number has been set up as a Unique field in the Catalog module.

In this exercise the fields updated are:

Field

Back-end name

IRN

irn

Accession No: (Accession Details)

TitAccessionNo

Condition Status: (Condition Check)

ConConditionStatus

Date Checked: (Condition Check)

ConDateChecked

Checked By: (Condition Check)

ConCheckedByRef

Condition Details: (Condition Check)

ConConditionDetails

  1. Create a new CSV Import data file with the following details:

Column Name

(Row 1)

Record 1

(Row 2)

Record 2

(Row 3)

irn

[IRN noted in Exercise 9]

 

TitAccessionNo

 

[Use the Accession Number that corresponds to your Login name]

[Train1] 1995.073.001

[Train2] 1997.079.002

[Train3] 1989.092.003

[Train4] 1898.189.004

[Train5] 1996.017.005

[Train6] 1993.372.006

[Train7] 1989.125.007

[Train8] 1993.372.008

[Train9] 1986.574.009

[Train10] 1993.372.010

ConConditionStatus

Excellent

Poor

ConDateChecked

[Today]

[Today]

ConCheckedByRef.NamLast

[Your login name]

[Your login name]

ConCheckedByRef.NamRoles_tab(1)

Conservator

Conservator

ConConditionDetails

The work is in excellent condition.

Loans can be approved (subject to normal conditions).

Due to the poor condition of this work, loans should not be approved.

  1. Save the Import data file as exercise10_train1.csv (where Train1 is your login name).
  2. Before importing the data, preform a Custom Import to validate the Import data file.
  3. When there are no validation errors, perform a Typical Import (and remember to include your login name as the Import Identifier).

    If all goes well, the log should indicate that 2 Catalog records have been updated and two attachments were made to the Parties module:

    db_report_cat_train.gif

  4. Examine the Catalog records to view how they have been updated.
  5. Edit exercise10_train1.csv (where Train1 is your login name) and:
    1. In Row 2, delete "The work is in excellent condition. Loans can be approved (subject to normal conditions)."
    2. In Row 3, add .001 to the end of the TitAccessionNo. For example, if TitAccessionNo=1995.073.001, it will now be 1995.073.001.001
  6. Save the Import data file and run the import again.

    The Import should complete but with one error:

    db_report_cat2_train.gif

  7. First, examine the Catalog record that did update. Note that Condition Details: (Condition Check) has been cleared.

    When an update is run, the content of the Import data file will update (i.e. overwrite) the content of any field listed in the Import data file. Be certain that you don't want to overwrite the contents of a field by leaving it blank.

  8. Why was there an error when updating the second record in your Import data file?

    There is no record with the Accession Number provided in the Import data file and as a result the Import Tool has attempted to create a new record using the details provided.

    As it happens, Object Category: (Object Details) is a mandatory field when creating a Catalog record and as the Import data file does not include this field, creation of the record fails.

  9. Edit exercise10_train1-error.csv (where Train1 is your login name) and:
    1. Add a column after TitAccessionNo and give it the header TitObjectCategory.
    2. In Row 2, record the Object Category as Work of Art.
  10. Save the file and run the import again.

    Once again there is an error, although a different one:

    db_report_cat3_train.gif

    Our Import data file includes a column for IRN but no value. If we include the IRN column in our Import data file, we can't create a record without supplying an IRN. If we were to supply a unique value for IRN, a record would be created using that IRN, however it is typically better to allow EMu to assign the IRN.

  11. Edit exercise10_train1-error-error.csv (where Train1 is your login name):
    1. Delete the IRN column.
    2. Add .001 to the end of the TitAccessionNo. For example, if TitAccessionNo=1995.073.001.001 it will now be 1995.073.001.001.001
  12. Save the file and run the import again.

    If all goes well, the Import Tool has created a new Catalog record using the unique Accession Number you provided in the Import data file and assigned a unique IRN to the record.